package com.leisurexi.aop.features.aspect;

import org.aspectj.lang.ProceedingJoinPoint;

/**
 * Aspect XML 配置类
 *
 * @author: leisurexi
 * @date: 2021-05-23 15:25
 */
public class AspectXmlConfig {

    public Object aroundAnyPublicMethod(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("@Around any public method.");
        return pjp.proceed();
    }

    public void beforeAnyPublicMethod() {
        System.out.println("@Before any public method.");
//        throw new RuntimeException(); // 测试 AfterThrowing
    }

    public void afterAnyPublicMethod() {
        System.out.println("@After any public method.");
    }

    public void afterReturningAnyPublicMethod() {
        System.out.println("@AfterReturning any public method.");
    }

    public void afterThrowingAnyPublicMethod() {
        System.out.println("@AfterThrowing any public method.");
    }

}
